package com.xbh.management.task.impl;

import com.xbh.management.model.ManDepartment;
import com.xbh.management.task.SuperExport;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.xssf.streaming.SXSSFRow;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @program: management-center
 * @description:
 * @author: 许宝华
 * @create: 2021-09-06 14:22
 */
@Component
@Scope("prototype")//多实例，IOC容器启动创建的时候，并不会创建对象放在容器在容器当中，当你需要的时候，需要从容器当中取该对象的时候，就会创建。
public class CustomerExportImpl extends SuperExport<ManDepartment> {
    /**
     * 按行填充数据
     * @param dateRow 行数
     * @param i 下标值
     * @param style 格式
     */
    @Override
    protected void handle(SXSSFRow dateRow, Integer i, CellStyle style) {

        ManDepartment customer = list.get(i);

        createCell(dateRow,0, i.toString(),style);
        createCell(dateRow,1, customer.getDepartmentName(),style);
        createCell(dateRow,2, customer.getCreateTime().toString(),style);
        createCell(dateRow,3, customer.getContractEmail(),style);
        createCell(dateRow,4, customer.getContractTelephone(),style);
        createCell(dateRow,5, customer.getDepartmentAddress(),style);
        createCell(dateRow,6, customer.getDepartmentNumber(),style);


    }
}
